package training.collection;

import java.util.Iterator;

public class IteratorImp<Element> implements Iterator<Element> {

	private Object[] elements;
	private int actual = 0;
	
	public IteratorImp(Object[] array){
		elements = array;
	}
	
	@Override
	public boolean hasNext() {
		return (actual <= (elements.length -1));
	}

	@SuppressWarnings("unchecked")
	@Override
	public Element next() {
		Element element = (Element) elements[actual];
		actual++;
		return element;
	}

	@Override
	public void remove() {
		// TODO Auto-generated method stub
	}

}
